% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/shapefile_xyz.R
\name{shapefile_from_any}
\alias{shapefile_from_any}
\title{Read shapefile from any file or folder (trying to infer the format)}
\usage{
shapefile_from_any(path = NULL, cleanit = TRUE, crs = 4269, layer = NULL, ...)
}
\arguments{
\item{path}{path of file(s) that is/are .gdb, .zip, .shp,
.geojson, .json, etc., or folder
\itemize{
\item If .zip or folder that has more than one shapefile in it,
cannot be read by this function,
and must be unzipped and handled separately.
\item If folder, tries to read with \code{\link[=shapefile_from_folder]{shapefile_from_folder()}}
Folder must contain one each of files with
extensions .shp, .shx, .dbf, and .prj
\item If .zip containing a folder, unzips, then tries to read with
\code{\link[=shapefile_from_folder]{shapefile_from_folder()}} or \code{\link[=shapefile_from_gdbzip]{shapefile_from_gdbzip()}} ?
\item If .zip containing .gdb, reads with \code{\link[=shapefile_from_gdbzip]{shapefile_from_gdbzip()}}
\item If .gdb, reads with \code{\link[=shapefile_from_gdb]{shapefile_from_gdb()}}
\item If .shp, reads with \code{\link[=shapefile_from_filepaths]{shapefile_from_filepaths()}}
which works only it is x.shp and no other .shp exists in folder
and x.shx, x.dbf, x.prj are in the folder.
\item If vector of .shp, .shx, .dbf, and .prj file names
(that may include paths), reads with \code{\link[=shapefile_from_filepaths]{shapefile_from_filepaths()}}
\item If .json or .geojson, reads with \code{\link[=shapefile_from_json]{shapefile_from_json()}}
}}

\item{cleanit}{set to FALSE if you want to skip validation and dropping invalid rows}

\item{crs}{passed to shapefile_from_filepaths() etc. and
default is crs = 4269 or Geodetic CRS NAD83}

\item{layer}{optional layer name passed to \code{\link[sf:st_read]{sf::st_read()}}}

\item{...}{passed to \code{\link[sf:st_read]{sf::st_read()}}}
}
\value{
a simple feature \link[sf:sf]{sf::sf} class object using \code{\link[sf:st_read]{sf::st_read()}}
}
\description{
Read shapefile from any file or folder (trying to infer the format)
}
\seealso{
\code{\link[=shapefile_from_folder]{shapefile_from_folder()}}
}
